<?php
    $routeAction =  preg_split("/@/", Route::currentRouteAction());
    $controllerName = isset($routeAction[0]) ? $routeAction[0]: '';
    $actionName = isset($routeAction[1]) ? $routeAction[1]: '';
?>
<ul class="menu-right">
@if ($controllerName == 'UserController')
    <li>{{ HTML::linkRoute('/', 'List')}}</li>
    <li>{{ HTML::linkRoute('profile', 'Profile')}}</li>
    <li>{{ HTML::linkRoute('create', 'Create')}}</li>

    @if ($actionName == 'view')
        <li>{{ HTML::linkRoute('edit', 'Edit', array('id' => Request::segment(5)))}}</li>
    @endif
@elseif ($controllerName == 'ProductController')
    <li>{{ HTML::linkRoute('product', 'List')}}</li>
    <li>{{ HTML::linkRoute('product/create', 'Create')}}</li>

    @if ($actionName == 'show')
        <li>{{ HTML::linkRoute('product/edit', 'Edit', array('id' => Request::segment(5)))}}</li>
    @endif
@elseif ($controllerName == 'CategoryController')
    <li>{{ HTML::linkRoute('category', 'List')}}</li>
    <li>{{ HTML::linkRoute('category/create', 'Create')}}</li>

    @if ($actionName == 'show')
        <li>{{ HTML::linkRoute('category/edit', 'Edit', array('id' => Request::segment(5)))}}</li>
    @endif
@endif
</ul>


